package com.winz.cultureapp.activity;

import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;
import android.widget.TextView;

import com.flyco.tablayout.SlidingTabLayout;
import com.winz.cultureapp.R;
import com.winz.cultureapp.adapter.vp.NewsVpAdapter;
import com.winz.cultureapp.base.BaseAppCompatActivity;
import com.winz.cultureapp.fragment.CollectionItem1Fragment;
import com.winz.cultureapp.fragment.CollectionItem2Fragment;
import com.winz.cultureapp.fragment.CollectionItem3Fragment;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * 我的收藏
 */
public class CollectionActivity extends BaseAppCompatActivity{

    @BindView(R.id.tv_top_title)
    TextView mTv_top_title;
    @BindView(R.id.stb_nav)
    SlidingTabLayout mStb_nav;
    @BindView(R.id.vp_list)
    ViewPager mVp_list;

    private String[] titles = {"志愿活动","文体活动","文化社团"};
    private List<Fragment> fragments = new ArrayList<>();

    @Override
    protected int contentView() {
        return R.layout.activity_collection;
    }

    @Override
    protected void initViews() {
        setStatusBar(getResources().getColor(R.color.base_color));
        mTv_top_title.setText(R.string.mine_top_item3);
        fragments.add(CollectionItem1Fragment.getInstance());
        fragments.add(CollectionItem2Fragment.getInstance());
        fragments.add(CollectionItem3Fragment.getInstance());
        NewsVpAdapter mAdapter = new NewsVpAdapter(getSupportFragmentManager(),fragments, titles);
        mVp_list.setAdapter(mAdapter);

        mStb_nav.setViewPager(mVp_list,titles);
    }

    @OnClick(R.id.fl_back)
    public void onClick() {
        finish();
    }
}
